
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports _2bMatesSite.BO

Namespace _2bMatesSite
	''' <summary>
	''' Summary description for group_welcome.
	''' </summary>
	Public Partial Class group_welcome
		Inherits BaseWebPage
		Protected lblNetworkPeopleCount As System.Web.UI.WebControls.Label
		Protected blankImagesCount As Integer = 0
		Protected sMembersCount As String = ""
		Protected grpID As Integer = -1
		Protected htPageConstants As New Hashtable()

		Public Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
			Me.pageTemplate.PageTitle = PageTitles.GROUP_WELCOME_PAGE

			' Auto login from an external link
			'AutoLogin( Request );

			Dim usr As User = LoggedUser
			If usr = Nothing Then
				Common.Utils.RedirectToLoginPage(Page)
			End If
			'Response.Redirect(Constants.DEFAULT);

			Me.initPageTitles(Constants.GROUP_WELCOME, "", Form1, Nothing, htPageConstants)
			Me.initAdvertisements(Form1, Nothing)

			If Constants.SHOW_GROUPS <> Constants.SHOW_ON Then
				Throw New Exception(Constants.ERROR_MESSAGE_NO_ACCESS)
			End If

			' wrong or no group id
			If Request.Params(Constants.GROUP_PARAM) = Nothing OrElse Request.Params(Constants.GROUP_PARAM) = "" Then
				Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
			End If

			Try
				grpID = Convert.ToInt32(Request.Params(Constants.GROUP_PARAM))
			Catch
				Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
			End Try
			Dim grp As Group = Groups.GetGroupByID(grpID)

			' the group doesn't exist
			If grp = Nothing Then
				Throw New Exception(Constants.ERROR_MESSAGE_GROUP_DOESNT_EXIST_ERROR)
			End If

			' the logged user is not a moderator of the group
			If grp.Uid <> usr.ID Then
				Response.Redirect(Constants.GROUP + "?" + Constants.GROUP_PARAM + "=" + grpID)
			End If

			' set group name
			litGroupName.Text = (Me.GetPageConstText(htPageConstants, "CONST_PageTitle_TEXT")).Replace("[PARAM]", grp.Name)

			' init profile viewed
			lblProfileViewedNum.Text = (Me.GetPageConstText(htPageConstants, "CONST_ProfileViewed_TEXT")).Replace("[PARAM]", grp.TimesViewed.ToString())

			' init profile links
			hlViewGroupProfile.NavigateUrl = "../" + Constants.GROUP + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlEditGroupProfile.NavigateUrl = "../" + Constants.EDIT_GROUP_BASIC + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlUploadGroupPhotos.NavigateUrl = "../" + Constants.UPLOAD_GROUP_PHOTO + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlUploadGroupSong.NavigateUrl = "../" + Constants.UPLOAD_GROUP_SONG + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlMembersComments.NavigateUrl = "../" + Constants.GROUP_COMMENTS_PAGE + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlSeeAllMembersUp.NavigateUrl = "../" + Constants.SEE_ALL_MEMBERS + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlSeeAllMembersDown.NavigateUrl = "../" + Constants.SEE_ALL_MEMBERS + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlMoreTips.NavigateUrl = "../#t"
			hlMoreTips.Attributes.Add("onclick", "javascript: loadRandomTip('_ctl0_lblTip');")

			'set group image
			Dim grpPicture As GroupPicture = DirectCast(grp.DefaultPicture, GroupPicture)
			If grpPicture <> Nothing Then
				imgGroupPicture.ImageUrl = Pictures.GetPictureLargeThumbnailSrcFullURL(grpPicture, "../")
			Else
				imgGroupPicture.ImageUrl = "../images/default_thumbnail.gif"
			End If
			imgGroupPicture.ToolTip = grp.Name

			' set members count
			sMembersCount = grp.Members.Count.ToString()

			' set group photos count
			Dim pics As ArrayList = grp.GetPictures()
			hlPhotosLink.Text = "<font class='main_text_opposite'>" + pics.Count.ToString() + "</font>" + " Photo"
			If pics.Count <> 1 Then
				hlPhotosLink.Text += "s"
			End If
			hlPhotosLink.Text += " in Album"

			hlPhotosLink.NavigateUrl = "../" + Constants.UPLOAD_GROUP_PHOTO + "?" + Constants.GROUP_PARAM + "=" + grp.ID

			' set notes table

			If grp.DefaultPicture = Nothing Then
				Dim lblNotes As New Label()
				lblNotes.Text = Me.GetPageConstText(htPageConstants, "CONST_Notes_TEXT")
				Dim controls As New ArrayList()
				controls.Add(lblNotes)
				addTableRow("notes", controls)
			End If

			If grp.DefaultPicture = Nothing Then
				Dim controls As New ArrayList()

				Dim lblNote As New Label()
				lblNote.Text = (Me.GetPageConstText(htPageConstants, "CONST_UploadPhoto_TEXT")).Replace("[PARAM]", "<A href='" + Constants.UPLOAD_GROUP_PHOTO + "?" + Constants.GROUP_PARAM + "=" + grp.ID + "' class='notes_text'>Upload</A>")
				controls.Add(lblNote)

				addTableRow("notes_td", controls)
			End If

			'end set notes table

			' set new messages count link
			Dim list As ArrayList = Messages.GetUserInboxUnreadMessages(usr.ID, False)
			Dim cnt As Integer = list.Count
			If cnt = 0 Then
				lblNewMessages.Visible = False
			Else
				lblNewMessages.Text = "<font class='main_text_err'>" + cnt + "</font> New Message"
				If cnt > 1 Then
					lblNewMessages.Text += "s"
				End If
			End If

			' init group comments count link
			list = grp.NewComments
			cnt = list.Count
			If cnt = 0 Then
				lblNewComments.Visible = False
			Else
				lblNewComments.Text = "<font class='main_text_err'>" + cnt + "</font> New Comment"
				If cnt > 1 Then
					lblNewComments.Text += "s"
				End If
			End If

			Dim arrGroupBulletinList As ArrayList = Messages.GetGroupBulletins(grp.ID, -1, -1)
			cnt = arrGroupBulletinList.Count
			If cnt = 0 Then
				lblNewGroupBulletins.Visible = False
			Else
				lblNewGroupBulletins.Text = "<font class='main_text_err'>" + cnt + "</font> New Group Bulletin"
				If cnt > 1 Then
					lblNewGroupBulletins.Text += "s"
				End If
			End If

			' init group bulletins links
			hlGroupBulletins.NavigateUrl = "../" + Constants.BULLETIN + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlAllBulletin.NavigateUrl = "../" + Constants.BULLETIN + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlPostBulletin.NavigateUrl = "../" + Constants.POST_BULLETIN + "?" + Constants.GROUP_PARAM + "=" + grp.ID

			' init group blog links
			hlGroupBlogs.NavigateUrl = "../" + Constants.BLOG + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlAllBlog.NavigateUrl = "../" + Constants.BLOG + "?" + Constants.GROUP_PARAM + "=" + grp.ID
			hlPostGroupBlog.NavigateUrl = "../" + Constants.SEND_BLOG + "?" + Constants.GROUP_PARAM + "=" + grp.ID

			' set Tips

			Dim randomNumber As New Random()
			lblTip.Text = Constants.TIPS_ARRAY(randomNumber.[Next](0, Constants.TIPS_ARRAY.Length - 1))

			If grp.Members.Count = 0 Then
				tblMembers.Visible = False
				hlSeeAllMembersUp.Visible = False
				hlSeeAllMembersDown.Visible = False
				imgEditMembers.Visible = False
				lbEditMembers.Visible = False
				lblNoMembers.Visible = True
			End If

			hlInviteToGroup.NavigateUrl = "../" + Constants.SEND_MESSAGE + "?action=" + Constants.MESSAGE_FORWARD_A_GROUP_ACTION + "&" + Constants.FORWARD_A_GROUP_PARAM + "=" + grpID

			hlViewMorePeople.NavigateUrl = "../" + Constants.BROWSE

			' Init count of users waiting to join the group if the group is private
			Dim grpPendingMembers As GroupsPendingUsers = grp.PendingMembers
			If grpPendingMembers.Count > 0 Then
				hlViewConfirmation.NavigateUrl = "../" + Constants.VIEW_AWAITING_CONFIRMATION + "?" + Constants.GROUP_PARAM + "=" + grp.ID
				hlViewConfirmation.Text = (Me.GetPageConstText(htPageConstants, "CONST_ViewAwaiting_TEXT")).Replace("[PARAM]", grpPendingMembers.Count.ToString())
				hlViewConfirmation.Visible = True
			End If

			' Bind data
			If Not IsPostBack Then
				' Init with group members
				If grp.Members.Count <> 0 Then
					BindList("gm")
				End If
				BindList("nf")
				BindGrid(dgBulletins, "bulletin")
				BindGrid(dgBlog, "blog")
			End If
		End Sub

		Public Function CreateDataSource(ByVal type As String) As ICollection
			Dim usr As User = LoggedUser
			Dim grp As Group = Groups.GetGroupByID(grpID)
			Dim startIndex As Integer = 0
			Dim endIndex As Integer = startIndex + Constants.MAX_PICTURES_ON_WELCOME_PAGE
			If type = "nf" Then
				endIndex -= 4
			End If
			' four new users less than the direct friends
			Dim i As Integer
			Dim dt As New DataTable()
			Dim dr As DataRow

			dt.Columns.Add(New DataColumn("ImageURL", GetType(String)))
			dt.Columns.Add(New DataColumn("Name", GetType(String)))
			dt.Columns.Add(New DataColumn("OnlineImg", GetType(String)))
			dt.Columns.Add(New DataColumn("FriendID", GetType(String)))
			dt.Columns.Add(New DataColumn("MemberURL", GetType(String)))
			dt.Columns.Add(New DataColumn("FullName", GetType(String)))
			dt.Columns.Add(New DataColumn("OnClickJS", GetType(String)))

			blankImagesCount = 0
			Dim imagesOnLastRow As Integer = 0
			Dim t As Integer = 0
			Dim counter As Integer = 0
			Dim UsersCount As Integer
			Dim LoggedUsersList As ArrayList = Common.Utils.GetLoggedUsersIDs()

			Select Case type
				Case "gm"
					UsersCount = grp.Members.Count
					Dim temp As UserPicture
					endIndex = Math.Min(endIndex, UsersCount)
					t = (endIndex - startIndex)
					Math.DivRem(t, Constants.MAX_PICTURES_ON_ROW_ON_WELCOME_PAGE, imagesOnLastRow)
					counter = 0

					For Each gm As BO.GroupMember In grp.Members
						If counter >= startIndex AndAlso counter < endIndex Then
							dr = dt.NewRow()
							temp = gm.User.DefaultPicture
							If temp <> Nothing Then
								dr(0) = Pictures.GetPictureSrcFullURL(temp, True, "../")
							Else
								dr(0) = "../images/default_thumbnail.gif"
							End If
							dr(1) = getBeginning(HttpUtility.HtmlEncode(gm.User.Name), Constants.MAX_NAME_LENGTH_ABOVE_IMAGE)
							If LoggedUsersList.Contains(gm.User.ID) Then
								dr(2) = "../images/online_status.gif"
							Else
								dr(2) = "../images/spacer.gif"
							End If
							dr(3) = gm.User.ID

							dr(4) = Users.ComposeMemeberLink(gm.User)
							dr(6) = Users.ComposeMemeberLinkOnClickJS(gm.User, trUserCanceledMessage)

							dr(5) = gm.User.Name
							dt.Rows.Add(dr)
						End If
						System.Math.Max(System.Threading.Interlocked.Increment(counter),counter - 1)
					Next
					Exit Select
				Case "nf"
					Dim usrNetworkedUsers As ArrayList = Users.GetRandomUsers(Constants.RANDOM_USERS_COUNT_ON_WELCOME_PAGE, False)
					UsersCount = usrNetworkedUsers.Count

					endIndex = Math.Min(endIndex, UsersCount)
					t = (endIndex - startIndex)
					Math.DivRem(t, Constants.MAX_PICTURES_ON_ROW_ON_WELCOME_PAGE, imagesOnLastRow)
					counter = 0

					For Each nf As BO.User In usrNetworkedUsers
						If counter >= startIndex AndAlso counter < endIndex Then
							dr = dt.NewRow()
							temp = nf.DefaultPicture
							If temp <> Nothing Then
								dr(0) = Pictures.GetPictureSrcFullURL(temp, True, "../")
							Else
								dr(0) = "../images/default_thumbnail.gif"
							End If
							dr(1) = getBeginning(HttpUtility.HtmlEncode(nf.Name), Constants.MAX_NAME_LENGTH_ABOVE_IMAGE)
							If LoggedUsersList.Contains(nf.ID) Then
								dr(2) = "../images/online_status.gif"
							Else
								dr(2) = "../images/spacer.gif"
							End If
							dr(3) = nf.ID
							'dr[4] = "../" + Constants.MEMBERS + "?id=" + nf.ID.ToString();
							dr(4) = Users.ComposeMemeberLink(nf)
							dr(6) = Users.ComposeMemeberLinkOnClickJS(nf, trUserCanceledMessage)
							dr(5) = nf.Name
							dt.Rows.Add(dr)
						End If
						System.Math.Max(System.Threading.Interlocked.Increment(counter),counter - 1)
					Next
					Exit Select
			End Select

			If imagesOnLastRow <> 0 Then
				blankImagesCount = Constants.MAX_PICTURES_ON_ROW_ON_WELCOME_PAGE - imagesOnLastRow
				i = imagesOnLastRow
				While i < Constants.MAX_PICTURES_ON_ROW_ON_WELCOME_PAGE
					dr = dt.NewRow()
					dr(0) = "../images/spacer.gif"
					dr(1) = ""
					dr(2) = "../images/spacer.gif"
					dt.Rows.Add(dr)
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While
			End If

			Dim dv As New DataView(dt)
			Return dv
		End Function

		Private Sub addTableRow(ByVal cssclass As String, ByVal ctls As ArrayList)
			Dim tr As New TableRow()
			Dim td As New TableCell()
			td.CssClass = cssclass
			For Each ctl As Control In ctls
				td.Controls.Add(ctl)
			Next
			tr.Cells.Add(td)
			tblNotes.Rows.Add(tr)
		End Sub

		Public Sub BindList(ByVal type As String)
			Dim itemsCount As Integer
			Dim blankImageIndex As Integer
			Dim i As Integer

			Select Case type
				Case "nf"
					dlNewPeople.DataSource = CreateDataSource(type)
					dlNewPeople.DataBind()

					itemsCount = dlNewPeople.Items.Count
					blankImageIndex = itemsCount - blankImagesCount
					i = 0
					i = blankImageIndex
					While i < itemsCount
						(DirectCast(dlNewPeople.Items(i).FindControl("hlName"), System.Web.UI.WebControls.HyperLink)).CssClass = "empty_image"
						(DirectCast(dlNewPeople.Items(i).FindControl("hlMemberPhoto"), System.Web.UI.WebControls.HyperLink)).CssClass = "empty_image"
						System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
					End While
					Exit Select
				Case "gm"
					dlAllMembers.DataSource = CreateDataSource(type)
					dlAllMembers.DataBind()

					itemsCount = dlAllMembers.Items.Count
					blankImageIndex = itemsCount - blankImagesCount
					i = 0
					i = blankImageIndex
					While i < itemsCount
						(DirectCast(dlAllMembers.Items(i).FindControl("hlName"), System.Web.UI.WebControls.HyperLink)).CssClass = "empty_image"
						(DirectCast(dlAllMembers.Items(i).FindControl("imgPhoto"), System.Web.UI.WebControls.Image)).CssClass = "empty_image"
						System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
					End While
					Exit Select
			End Select
		End Sub

		Protected Function CreateDataSourceForGrid(ByVal type As String) As ICollection
			Dim usr As BO.User = LoggedUser

			Dim msgList As ArrayList
			Dim dt As New DataTable()

			' List user's inbox messages
			Select Case type
				Case "bulletin"
					msgList = Messages.GetGroupBulletins(grpID, 0, -1)
					Exit Select
				Case "blog"
					msgList = Messages.GetGroupBlogs(grpID)
					Exit Select
				Case Else
					msgList = Messages.GetGroupBulletins(grpID, 0, -1)
					Exit Select
			End Select
			If msgList.Count = 0 Then
				If type = "bulletin" Then
					dgBulletins.Visible = False
					hlAllBulletin.Visible = False
					lblEmptyBulletins.Visible = True
				End If
				If type = "blog" Then
					dgBlog.Visible = False
					hlAllBlog.Visible = False
					lblEmptyBlog.Visible = True
				End If
			Else
				Dim startIndex As Integer = 0
				Dim endIndex As Integer = startIndex + Constants.MAX_MESSAGES_ON_WELCOME_PAGE
				endIndex = Math.Min(endIndex, msgList.Count)
				Dim curMessageDate As DateTime
				Dim dr As DataRow

				dt.Columns.Add(New DataColumn("MessageID", GetType(Integer)))
				dt.Columns.Add(New DataColumn("Date", GetType(String)))
				dt.Columns.Add(New DataColumn("URL", GetType(String)))
				dt.Columns.Add(New DataColumn("FriendID", GetType(String)))
				dt.Columns.Add(New DataColumn("SenderName", GetType(String)))
				dt.Columns.Add(New DataColumn("Subject", GetType(String)))
				dt.Columns.Add(New DataColumn("ViewMsgURL", GetType(String)))
				dt.Columns.Add(New DataColumn("MemberURL", GetType(String)))
				dt.Columns.Add(New DataColumn("OnClickJS", GetType(String)))
				'dt.Columns.Add(new DataColumn("MessageIDAndType", typeof(string)));

				' List user's inbox messages					
				Dim i As Integer = startIndex
				While i < endIndex
					dr = dt.NewRow()

					Select Case type
						Case "bulletin"
							' Init group bulletin
							Dim bul As GroupBulletinMessage = DirectCast(msgList(i), GroupBulletinMessage)
							curMessageDate = bul.DateSent
							dr(0) = bul.ID
							dr(1) = Constants.ARR_MONTHS(curMessageDate.Month - 1) + " " + curMessageDate.Day + "<br />" + curMessageDate.ToShortTimeString()
							dr(2) = "../" + Constants.MEMBERS + "?id=" + bul.SenderID.ToString()
							dr(3) = bul.SenderID.ToString()
							dr(4) = getBeginning(HttpUtility.HtmlEncode(bul.Sender.Name), Constants.MAX_NAME_LENGTH_ABOVE_IMAGE)
							dr(5) = Server.HtmlEncode(bul.Subject)
							dr(6) = "../" + Constants.VIEW_MESSAGE + "?id=" + bul.ID + "&" + Constants.GROUP_PARAM + "=" + grpID + "&" + Constants.MSGBOX_PARAM + "=" + Constants.MSGBOX_BULLETIN
							


							dr(7) = Users.ComposeMemeberLink(bul.Sender)
							dr(8) = Users.ComposeMemeberLinkOnClickJS(bul.Sender, trUserCanceledMessage)

							Exit Select
						Case "blog"
							' Init group blog
							Dim blog As GroupBlog = DirectCast(msgList(i), GroupBlog)
							curMessageDate = blog.DateSent
							dr(0) = blog.ID
							dr(1) = Constants.ARR_MONTHS(curMessageDate.Month - 1) + " " + curMessageDate.Day + "<br />" + curMessageDate.ToShortTimeString()
							dr(2) = "../" + Constants.MEMBERS + "?id=" + blog.SenderID.ToString()
							dr(3) = blog.SenderID.ToString()
							dr(4) = getBeginning(HttpUtility.HtmlEncode(blog.Sender.Name), Constants.MAX_NAME_LENGTH_ABOVE_IMAGE)
							dr(5) = Server.HtmlEncode(blog.Subject)
							dr(6) = "../" + Constants.VIEW_BLOG_COMMENTS + "?id=" + blog.ID + "&" + Constants.GROUP_PARAM + "=" + grpID
							dr(7) = Users.ComposeMemeberLink(blog.Sender)
							dr(8) = Users.ComposeMemeberLinkOnClickJS(blog.Sender, trUserCanceledMessage)
							Exit Select
					End Select
					dt.Rows.Add(dr)
					System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
				End While
			End If
			Dim dv As New DataView(dt)
			Return dv
		End Function

		Protected Sub BindGrid(ByVal gridName As DataGrid, ByVal type As String)
			'init datagrid with database data ordered by "orederBy" param
			gridName.DataSource = CreateDataSourceForGrid(type)
			gridName.DataBind()
		End Sub

		Protected Sub lbEditMembers_Click(ByVal sender As Object, ByVal e As System.EventArgs)
			Response.Redirect(Constants.SEE_ALL_MEMBERS + "?" + Constants.GROUP_PARAM + "=" + grpID + "&action=" + Constants.SEE_ALL_FRIENDS_EDIT_ACTION)
		End Sub

		Private Sub dlAllMembers_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs)
			Dim src As Object = e.CommandSource
			Dim srcType As String = src.[GetType]().ToString()
			Dim cmd As String = e.CommandName
			Dim arg As String = ""
			If srcType.Equals("System.Web.UI.WebControls.ImageButton") Then
				arg = (DirectCast(src, ImageButton)).CommandArgument
			Else
				arg = (DirectCast(src, LinkButton)).CommandArgument
			End If
			Select Case cmd
				Case "MemberRedirect"
					Response.Redirect(Constants.MEMBERS + "?id=" + e.CommandArgument)
					Exit Select
			End Select
		End Sub

		Private Sub dgBulletins_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
			' Init for group bulletins
			Dim src As Object = e.CommandSource
			Dim srcType As String = src.[GetType]().ToString()
			Dim cmd As String = e.CommandName
			Dim arg As String = ""
			If srcType.Equals("System.Web.UI.WebControls.ImageButton") Then
				arg = (DirectCast(src, ImageButton)).CommandArgument
			Else
				arg = (DirectCast(src, LinkButton)).CommandArgument
			End If
			Select Case cmd
				Case "MemberRedirect"
					Response.Redirect(Constants.MEMBERS + "?id=" + e.CommandArgument)
					Exit Select
			End Select
		End Sub

		Protected Sub lbAddMembers_Click(ByVal sender As Object, ByVal e As System.EventArgs)
			'Response.Redirect(Constants.INVITE_FRIENDS_PAGE + "?" + Constants.GROUP_PARAM + "=" + grpID);
			Response.Redirect(Constants.SEND_MESSAGE + "?action=" + Constants.MESSAGE_FORWARD_A_GROUP_ACTION + "&" + Constants.FORWARD_A_GROUP_PARAM + "=" + grpID)
		End Sub


		#region Web Form Designer generated code
		Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
			'
			' CODEGEN: This call is required by the ASP.NET Web Form Designer.
			'
			InitializeComponent()
			MyBase.OnInit(e)
		End Sub

		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()
			AddHandler Me.dgBulletins.ItemCommand, AddressOf Me.dgBulletins_ItemCommand

		End Sub
#End Region

		====================
		' This public property was added by conversion wizard to allow the access of a protected, autogenerated member variable Form1.
		====================
		Public ReadOnly Property Form1() As System.Web.UI.HtmlControls.HtmlForm
			Get
				Return Migrated_Form1
			End Get
		End Property
		'set { Migrated_Form1 = value; }
	End Class
End Namespace






